package com.zhuoshi.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zhuoshi.entity.Project;
import com.zhuoshi.entity.ProjectCustom;
import com.zhuoshi.mapper.ProjectMapper;
import com.zhuoshi.service.ProjectService;;
@Service("projectService")
@Transactional
public class ProjectServiceImpl implements ProjectService{
	
	@Autowired
	private ProjectMapper ProjectMapper;

	public List<Project> selectAllProjectLiu()  throws Exception{
		return ProjectMapper.selectByExample(null);
	}
//	查询所有项目（小伟）
	public List<Project> selectAllProjectYao() throws Exception {
		return ProjectMapper.selectByExample(null);
	}
	
	//查询所有项目扩展类
	public List<ProjectCustom> selectAllProjectCustomLiu(String name) {
		return ProjectMapper.selectAllProjectCustomLiu(name);
	}
	
	//通过id删除项目
	public int deleteProjectByIdLiu(int id) {
		return ProjectMapper.deleteByPrimaryKey(id);
	}
	
	//确认添加
	public int addProjectConfirmLiu(Project project) {
		return ProjectMapper.insertSelective(project);
	}
	
	//通过id查询项目的扩展类
	public ProjectCustom selectAllProjectCustomByIdLiu(int id) {
		return ProjectMapper.selectAllProjectCustomByIdLiu(id);
	}
	
	//确认修改
	public int updateProjectConfirmLiu(Project project) {
		return ProjectMapper.updateByPrimaryKeySelective(project);
	}

}
